package com.lbi.mvc.adaptors {
	import asunit.framework.TestCase;	
	public class XMLListLoaderTest extends TestCase {
			public function testXMLParsing() : void {
			var test_xml  : XML = 	<people>
										<person name="mike" level="leader"/>
										<person name="justin" level="senior associate"/>
										<person name="neil" level="associate"/>
										<person name="filipe" level="graduate"/>
									</people>;
			var list : XMLList= new XMLList(test_xml..person);
			assertEquals("list was=\n" + list,"leader",list[0].@level);
		}

		public function testDynamicTargetting() : void {
			var test_xml : XML = <menu>
									<starters>
										<vegetarian>
											<item name="pointless sausages"/>
											<item name="nuts"/>
											<item name="cous cous"/>
										</vegetarian>
									</starters>
									<mains>
										<item name="real sausage"/>
									</mains>
								</menu>;
			var list : XMLList = new XMLList(test_xml.descendants("item"));
			assertEquals("list was=\n" + list, "pointless sausages", list[0].@name);
			//assertEquals("list was=\n" + list, 3, list.length()); TODO reinstate
		}
		
	}
}